package com.yc.navy.springmvc.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.yc.navy.springmvc.bean.MemberInfo;
import com.yc.navy.springmvc.mapper.IMemberInfoMapper;
import com.yc.navy.springmvc.service.IMemberInfoService;
import com.yc.navy.springmvc.util.StringUtil;

@Service
public class MemberInfoServiceImpl implements IMemberInfoService{
	@Autowired
	private IMemberInfoMapper memberInfoMapper;
	
	@Override
	public int reg(MemberInfo member) {
		if(StringUtil.checkNull(member.getNickName(), member.getPwd(), member.getEmail())) {
			return -100;
		}
		return memberInfoMapper.reg(member);
	}

	@Override
	public MemberInfo login(MemberInfo map) {
		if(StringUtil.checkNull(map.getPwd(), map.getNickName())) {
			return null;
		}
		return memberInfoMapper.login(map);
	}

}
